export default function define(Blocks: Blockly.BlockDefinitions) {

  var maincolour = "#ff0066";
  var bordercolour = "#b3235a";
  var inputcolour = "#ff0066";
 Blocks['init_load'] = {
    init: function () {
      this.appendDummyInput()
        .appendField('加载音乐');
      this.appendValueInput("path")
        .setCheck(null);
      this.setInputsInline(true);
      this.setPreviousStatement(true, null);
      this.setNextStatement(true, null);
      this.setColour(maincolour, inputcolour, bordercolour);
      this.setTooltip("");
      this.setHelpUrl("");
    },
  };
  
 Blocks['mixer_play'] = {
    init: function () {
      this.appendDummyInput()
        .appendField('开始播放选择的音乐');
      this.setInputsInline(true);
      this.setPreviousStatement(true, null);
      this.setNextStatement(true, null);
      this.setColour(maincolour, inputcolour, bordercolour);
      this.setTooltip("");
      this.setHelpUrl("");
    },
  };
  
  Blocks['mixer_rewind'] = {
    init: function () {
      this.appendDummyInput()
        .appendField('重新播放选择的音乐');
      this.setInputsInline(true);
      this.setPreviousStatement(true, null);
      this.setNextStatement(true, null);
      this.setColour(maincolour, inputcolour, bordercolour);
      this.setTooltip("");
      this.setHelpUrl("");
    },
  };
  
  Blocks['mixer_stop'] = {
    init: function () {
      this.appendDummyInput()
        .appendField('停止播放选择的音乐');
      this.setInputsInline(true);
      this.setPreviousStatement(true, null);
      this.setNextStatement(true, null);
      this.setColour(maincolour, inputcolour, bordercolour);
      this.setTooltip("");
      this.setHelpUrl("");
    },
  };
  
  Blocks['mixer_pause'] = {
    init: function () {
      this.appendDummyInput()
        .appendField('暂停播放选择的音乐');
      this.setInputsInline(true);
      this.setPreviousStatement(true, null);
      this.setNextStatement(true, null);
      this.setColour(maincolour, inputcolour, bordercolour);
      this.setTooltip("");
      this.setHelpUrl("");
    },
  };
  
  Blocks['mixer_unpause'] = {
    init: function () {
      this.appendDummyInput()
        .appendField('继续播放选择的音乐');
      this.setInputsInline(true);
      this.setPreviousStatement(true, null);
      this.setNextStatement(true, null);
      this.setColour(maincolour, inputcolour, bordercolour);
      this.setTooltip("");
      this.setHelpUrl("");
    },
  };
  
  Blocks['mixer_set_volume'] = {
    init: function () {
      this.appendDummyInput()
        .appendField('设置选择的音乐音量为');
      this.appendValueInput("vol")
        .setCheck(null);
      this.setInputsInline(true);
      this.setPreviousStatement(true, null);
      this.setNextStatement(true, null);
      this.setColour(maincolour, inputcolour, bordercolour);
      this.setTooltip("");
      this.setHelpUrl("");
    },
  };
  
  Blocks['mixer_get_volume'] = {
    init: function () {
      this.appendDummyInput()
        .appendField('获取选择音乐的音量');
      this.setInputsInline(true);
      this.setOutput(true, null);
      this.setOutputShape(Blockly.OUTPUT_SHAPE_ROUND);
      this.setColour(maincolour, inputcolour, bordercolour);
      this.setTooltip('');
      this.setHelpUrl('');
    },
  };
  
  Blocks['mixer_get_busy'] = {
    init: function () {
      this.appendDummyInput()
        .appendField('是否正在播放？');
      this.setInputsInline(true);
      this.setOutput(true, null);
      this.setOutputShape(Blockly.OUTPUT_SHAPE_ROUND);
      this.setColour(maincolour, inputcolour, bordercolour);
      this.setTooltip('');
      this.setHelpUrl('');
    },
  };


}

